/**
 * 
 */
package com.example.gensurdatviwi.application.datamodel;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


/**
 * @author Michael Hausegger
 *
 */
public final class ToolBoxCollection implements Serializable {
	
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1274491239795723636L;



	
	public static List<SurveyDatabaseField>  supportedSurveyDatabaseFields = getSupportedSurveyDatabaseFieldsInitially();
	
	
	

	public static List<SurveyDatabaseField> getSupportedSurveyDatabaseFields(){
		
		return supportedSurveyDatabaseFields;
		
	}
	
	
	
	public static SurveyDatabaseField getSupportedSurveyDatabaseFieldById(Long id){
	
		for( SurveyDatabaseField field : supportedSurveyDatabaseFields ){
			
			if ( field.getId().equals(id) )
				return field;
			
		}
		
		
		throw new IllegalArgumentException("Surveydatabasefield with this id does not exist!");
		
	}
	

	
	private static List<SurveyDatabaseField> getSupportedSurveyDatabaseFieldsInitially(){
		
		List<SurveyDatabaseField> list = new ArrayList<SurveyDatabaseField>();
		
		
		list.add(new SurveyDatabaseField( new Long(1)
				                        , "Textfeld"
				                        , "textfield.png"
				                        , "Textfeld einfügen"
				                        , String.class
				                        )
		);
		
		
		list.add(new SurveyDatabaseField( new Long(2)
						                , "Nummernfeld"
						                , "numberfield.png"
						                , "Nummernfeld einfügen"
						                , Integer.class
						                )
						);
		
		
		list.add(new SurveyDatabaseField( new Long(3)
                                       , "Datumsfeld"
                                       , "datefield.png"
                                       , "Datumsfeld einfügen"
                                       , Integer.class
                                       )
                );
	
		
		
		return list;
		
		
	}
	
	

}
